Most data communications between two data processing systems involve a request for data and a response containing the requested data. For example, a client data processing system requests data by sending a request message using HyperText Transfer Protocol (http or HTTP) to a server data processing system. The server, using HTTP, sends a response message containing the data to the client.
A client can request data updates on an ongoing basis. For example, in a client-server environment using live query type of requests, a client essentially subscribes to an ongoing feed of data updates from a server-side, or backend, data processing environment. Live query, also known as dynamic query or continuous query, is a method by which a client requests ongoing updates on an event or state of something.
A simple example of live query is a request from a browser to live stock price of a stock ticker, where in response to such a query, a server supplies the browser ongoing updates of the changing stock price of that ticker. To provide ongoing updates in response to a request, a server typically monitors the changes in a database or the changes in the state of an event. The server may monitor these changes by polling the database or periodically observing the event for any changes from previous data in the database or from the previous state of the event.
HTTP protocol only supports a request-response model where clients initiate the requests and the servers respond to the client requests. In the standard HTTP model, a server cannot push responses back to a client without a corresponding request pending from the client. In a live query type publish-subscribe system, servers directly push the content back to clients. This type of operation can be achieved through a protocol, such as websockets, that supports bi-directional communication between client and server.
In a client-server model where clients subscribe to such dynamic content feed generated by the servers, multiple servers can be used for load balancing. One form of load balancing to support horizontal scaling is to use independent servers where the servers are not aware of what other servers are doing for the same or different clients. In a server-side data processing environment, where multiple independent servers with no shared state information about each other operate together to serve numerous requests from numerous clients, an incoming request from a client for subscribing or unsubscribing from receiving such data updates can be routed to any server for processing.